﻿function func_page_init__success(data, textStatus, jqXHR) {
		console.log(data);
		console.log(textStatus);


		var entity_abc__mall_fun_item = data.page.entity_abc__mall_fun_item;
		var left_count = data.page.left_count; //剩余量


		if (entity_abc__mall_fun_item.abc_pic_l) {
			$('.hd-img img').attr('src', img_url(entity_abc__mall_fun_item.abc_pic_l));
		}

		$('.product-info .desc').html(entity_abc__mall_fun_item.abc_content_short);
		$('.product-info .time').html(data.page.time);
		$('.product_price').html('单价：<span>' + entity_abc__mall_fun_item.abc_fun + '</span>' + pub_fun_name);
 		$('.product_left').html('余量：<span>' + left_count + '</span>'); 

		if (left_count <= 0) {
			$('.exchange_btn').addClass("disabled").html('已兑完');
		};


	$('.exchange_btn').click(function () {
			if (left_count > 0)
			{
				if (confirm("确定兑换？"))
				{
					func_change();
				}
			}
			else {
				func_alert("商品已兑换光");
			}
		});
	}


	function func_change__success(data, textStatus, jqXHR) {
		if (data.errcode == 0) {
			func_alert("兑换成功");
		}
		else {
			func_alert(data.errmsg);
		}
	}